package top.ranzhang.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import top.ranzhang.bean.entity.Enrollments;
import top.ranzhang.mapper.EnrollmentsMapper;
import top.ranzhang.service.IEnrollmentsService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class EnrollmentsServiceImpl extends ServiceImpl<EnrollmentsMapper, Enrollments> implements IEnrollmentsService {

    @Autowired
    private EnrollmentsMapper enrollmentsMapper;

    @Override
    public Enrollments getById(Long id) {
        return enrollmentsMapper.selectById(id);
    }

    @Override
    public List<Enrollments> getAll() {
        return enrollmentsMapper.selectAll();
    }

    @Override
    public void MIave(Enrollments enrollment) {
        enrollmentsMapper.MInsert(enrollment);
    }

    @Override
    public void update(Enrollments enrollment) {
        enrollmentsMapper.update(enrollment);
    }

    @Override
    public void delete(Long id) {
        enrollmentsMapper.delete(id);
    }
}
